# annualInterestRate = eval(input("请输入年利率："))
# year = eval(input("请输入贷款年限:"))
# money = eval(input("请输入贷款金额:"))

def pay(money=1910000,year=30,rate=4.9):
    annualInterestRate = rate
    monthRate = annualInterestRate / 1200

    monthPay = (money*monthRate) / (1 - ( 1 / (1+monthRate) ** (year*12) ));
    totalPay = monthPay * year*12
    return (monthPay, totalPay,money,rate)

dk_year = 30

monthPay1,totalPay1,money1,rate = pay(year=dk_year)
print("纯商货:",rate,"(",money1,")")
print("月供：", format(monthPay1, "10.3f"), "，总金额：", format(totalPay1, "10.3f"))

print()
monthPay2, totalPay2,sy_money,rate2 = pay(1510000,year=dk_year,rate=4.9)
monthPay3, totalPay3,gjj_money,rate3 = pay(400000,year=dk_year,rate=3.25)

print("商货:",rate2,"(",sy_money,")+公积金:",rate3,"(",gjj_money,")")
print("月供：", format(monthPay2 + monthPay3, "10.3f"), "，总金额：", format(totalPay2 + totalPay3, "10.3f"))

print()
print("两个贷款对比：")

print("月供：", format(monthPay1-monthPay2 - monthPay3, "10.3f"),",总金额：",format(totalPay1-totalPay2-totalPay3,"10.3f"))